package com.aaa.controller;

import com.aaa.entity.UMS_Role;
import com.aaa.service.UMS_RoleService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("ums_role")
public class UMS_RoleController {
    @Resource
    UMS_RoleService ums_roleService;

    @RequestMapping("list")
    public List<UMS_Role> list() {
        return ums_roleService.list();
    }

    @RequestMapping("add")
    public Integer add(String name, String description, Integer status) {
        return ums_roleService.add(name, description, status);
    }

    @RequestMapping("updAll")
    public Integer updAll(String name, String description, Integer status, Integer id) {
        return ums_roleService.updAll(name, description, status, id);
    }

    @RequestMapping("del")
    public Boolean del(Integer id) {
        return ums_roleService.removeById(id);
    }
}
